function newMat=InsertMat(oriMat,lowerRightMat,upperRightMat,lowerLeftMat)
[rowOri,colOri]=size(oriMat);
[rowSub1,colSub1]=size(lowerRightMat);%adhere subMat1 in lower right corner
[rowSub2,colSub2]=size(upperRightMat);%adhere subMat1 in upper right corner
[rowSub3,colSub3]=size(lowerLeftMat);%adhere subMat1 in lower left corner
% upperRightMat=zeros(rowOri,colSub1);
% lowerLeftMat=zeros(rowSub1,colOri);

if rowSub2==1&colSub2==1
    upperRightMat=repmat(upperRightMat,rowOri,colSub1);
end
if rowSub3==1&colSub3==1
    lowerLeftMat=repmat(lowerLeftMat,rowSub1,colOri);
end
[rowSub2,colSub2]=size(upperRightMat);%adhere subMat1 in upper right corner
[rowSub3,colSub3]=size(lowerLeftMat);%adhere subMat1 in lower left corner
rowDiff2=rowOri-rowSub2;
colDiff2=colSub1-colSub2;
rowDiff3=rowSub1-rowSub3;
colDiff3=colOri-colSub3;
if rowDiff2==0&rowDiff3==0&colDiff2==0&colDiff3==0
    newMat=[oriMat upperRightMat;lowerLeftMat lowerRightMat];
else
    error('The size of subMatrix is not matching!');
end





